import React from 'react'

interface PropsType {
  title: string
  desc?: string
}

const QuestionInfo: React.FC<PropsType> = ({ title, desc = '' }) => {
  const descTextList = desc.split('\n')
  return (
    <div style={{ textAlign: 'center' }}>
      <h1>{title}</h1>
      <p>
        {descTextList.map((t, index) => {
          return (
            <span key={index}>
              {index > 0 && <br />}
              {t}
            </span>
          )
        })}
      </p>
    </div>
  )
}

export default QuestionInfo
